# coding: utf-8
from PySide6.QtWidgets import QWidget
from qfluentwidgets import TreeWidget

from qeventmanager import qevent_manager
from api import SvgAPI


class CoursewareWidget(TreeWidget):
    def __init__(self, parent=None):
        super().__init__(parent)

    def loadData(self):
        qevent_manager.addTask(SvgAPI.getCoursewareTree, slot=self.onSetCoursewareTree)

    def onSetCoursewareTree(self, result: dict):
        print(result)
